<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Appendix C. Implementing Text Editing</title>
    <link rel="stylesheet" href="style.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Clutter编程" />
    <link rel="up" href="index.html" title="Clutter编程" />
    <link rel="prev" href="scrolling-container-example.html" title="Example" />
    <link rel="next" href="multiline-text-entry-example.html" title="Example" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">Appendix C. Implementing Text Editing</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="scrolling-container-example.html"><img src="../icons/prev.png" alt="Prev" /></a> </td>
          <th width="60%" align="center"> </th>
          <td width="20%" align="right"> <a accesskey="n" href="multiline-text-entry-example.html"><img src="../icons/next.png" alt="Next" /></a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="appendix" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title"><a id="appendix-implementing-text-editing"></a>Appendix C. Implementing Text Editing</h2>
          </div>
        </div>
      </div>
      <div class="toc">
        <p>
          <b>Table of Contents</b>
        </p>
        <ul>
          <li>
            <span class="sect1">
              <a href="appendix-implementing-text-editing.html#id3032694">The Technique</a>
            </span>
          </li>
          <li>
            <span class="sect1">
              <a href="multiline-text-entry-example.html">Example</a>
            </span>
          </li>
        </ul>
      </div>
      <div class="sect1" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title" style="clear: both"><a id="id3032694"></a>The Technique</h2>
            </div>
          </div>
        </div>
        <p>
<span class="application">Clutter</span> provides a <code class="classname">ClutterEntry</code> actor for text entry. 
However, this is limited to single lines of text. Therefore you will need to 
implement your own custom actor if you need this functionality with multiple 
lines of text.
</p>
        <p>Like <code class="classname">ClutterEntry</code> you can use the Pango API - 
specifically the <code class="classname">PangoLayout</code> object. The 
<code class="classname">PangoLayout</code> can then be rendered to the clutter display  
in your <code class="function">ClutterActor::paint()</code> implementation by using 
the <code class="function">pango_clutter_render_layout()</code> utility function.
</p>
        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="../icons/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>
However, <code class="function">pango_clutter_render_layout()</code> is not official 
public <span class="application">Clutter</span> API and could disappear in future version of <span class="application">Clutter</span>. You 
may choose to investigate its implementation and reimplement it in your 
application. Future versions of Pango are likely to provide new API to make 
this easier. 
</p>
              </td>
            </tr>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="scrolling-container-example.html"><img src="../icons/prev.png" alt="Prev" /></a> </td>
          <td width="20%" align="center"> </td>
          <td width="40%" align="right"> <a accesskey="n" href="multiline-text-entry-example.html"><img src="../icons/next.png" alt="Next" /></a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">Example </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">
              <img src="../icons/home.png" alt="Home" />
            </a>
          </td>
          <td width="40%" align="right" valign="top"> Example</td>
        </tr>
      </table>
    </div>
  </body>
</html>
